#include "AIS_My2dText.h"
#include "Prs3d_Text.hxx"


AIS_My2dText::AIS_My2dText(int x, int y, char* text) :
	myPos(gp_Pnt2d(x,y)),
	myText(text)
{
	SetTransformPersistence(new Graphic3d_TransformPers(Graphic3d_TMF_2d, Aspect_TOTP_LEFT_UPPER));
	SetZLayer(Graphic3d_ZLayerId_TopOSD);
}


void AIS_My2dText::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
	const Handle(Prs3d_Presentation)& thePrs, const Standard_Integer aMode)
{
	Handle(Prs3d_TextAspect) anTextAsp = new Prs3d_TextAspect();
	anTextAsp->SetHeight(50);
	anTextAsp->SetColor(Quantity_NOC_BLACK);

	Prs3d_Text::Draw(thePrs->CurrentGroup(), anTextAsp, myText, gp_Pnt(myPos.X(), myPos.Y(), 2));
}